package dongshi.daddy.facade.workuse.v2;

import java.util.HashSet;

// 模拟使用门面发送消息的业务类
public class MockBusinessUseFacade {
    private MessageSenderFacade messageSenderFacade = new dongshi.daddy.facade.workuse.v2.MessageSenderFacade();
    // 模拟车主支付货源发送站内信，推送，短信
    void pay() {
        System.out.println("车主支付完成了。。。开始发送消息");
        /*new PushMessageSender().send();
        new SmsMessageSender().send();
        new StationMessageSender().send();*/
        messageSenderFacade.send(new HashSet() {
            {
                add(MessageSendCode.PUSH_CODE);
                add(MessageSendCode.STATION_CODE);
                add(MessageSendCode.SMS_CODE);
            }
        });
    }

    // 模拟货主同意车主装货，发送短信
    void agree() {
        System.out.println("货主同意装货了。。。开始发送消息");
        /*new SmsMessageSender().send();*/
        messageSenderFacade.send(new HashSet() {
            {
                add(MessageSendCode.SMS_CODE);
            }
        });

    }

    // 模拟车主装货完毕，发送推送，短信给货主
    void loadOver() {
        System.out.println("车主装货完毕了。。。开始发送消息");
        /*new PushMessageSender().send();
        new SmsMessageSender().send();
        new StationMessageSender().send();*/
        messageSenderFacade.send(new HashSet() {
            {
                add(MessageSendCode.PUSH_CODE);
                add(MessageSendCode.SMS_CODE);
            }
        });

    }

}
